package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    // 无需编写方法，BaseMapper已提供基本CRUD功能

    @Update("UPDATE user_info SET age = age + #{addAge} ${ew.customSqlSegment}")
    int updateUserByCustom(@Param("addAge") int addAge,
                           @Param(Constants.WRAPPER) Wrapper<UserInfo> wrapper);
}
